/**
 * 
 */
package com.myBase.core.entity;

import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.myBase.common.persistence.BaseEntity;

/**
 * 金币相关规则Entity
 * @author 金币相关规则
 * @version 2017-05-17
 */
public class GoldcoinRelateRules extends BaseEntity<GoldcoinRelateRules> {
	
	private static final long serialVersionUID = 1L;
	private Integer goldcoinid;		// 关联goldCoin表 的id
	private Integer ruleid;		// 规则集id
	private String distributiostyle;		// 发放类型（百分比   01，随机    0 2，固定发放个数   03）
	private String percent;		// 百分比
	private String random;		// 随机
	private Integer fixeddistributionnumber;		// 固定发放个数
	private Date createtime;		// 录入时间
	
	@NotNull(message="关联goldCoin表 的id不能为空")
	public Integer getGoldcoinid() {
		return goldcoinid;
	}

	public void setGoldcoinid(Integer goldcoinid) {
		this.goldcoinid = goldcoinid;
	}
	
	@NotNull(message="规则集id不能为空")
	public Integer getRuleid() {
		return ruleid;
	}

	public void setRuleid(Integer ruleid) {
		this.ruleid = ruleid;
	}
	
	@Length(min=1, max=8, message="发放类型（百分比   01，随机    0 2，固定发放个数   03）长度必须介于 1 和 8 之间")
	public String getDistributiostyle() {
		return distributiostyle;
	}

	public void setDistributiostyle(String distributiostyle) {
		this.distributiostyle = distributiostyle;
	}
	
	@Length(min=0, max=8, message="百分比长度必须介于 0 和 8 之间")
	public String getPercent() {
		return percent;
	}

	public void setPercent(String percent) {
		this.percent = percent;
	}
	
	@Length(min=0, max=8, message="随机长度必须介于 0 和 8 之间")
	public String getRandom() {
		return random;
	}

	public void setRandom(String random) {
		this.random = random;
	}
	
	public Integer getFixeddistributionnumber() {
		return fixeddistributionnumber;
	}

	public void setFixeddistributionnumber(Integer fixeddistributionnumber) {
		this.fixeddistributionnumber = fixeddistributionnumber;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getCreatetime() {
		return createtime;
	}

	public void setCreatetime(Date createtime) {
		this.createtime = createtime;
	}
	
}